package com.atguigu.auth.util;

import com.aliyun.teaopenapi.models.Config;
public class SMSutils {
    /**
     * 使用AK&SK初始化账号Client
     * @param accessKeyId
     * @param accessKeySecret
     * @return Client
     * @throws Exception
     */
    public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
        Config config = new Config()
                // 您的AccessKey ID
                .setAccessKeyId("LTAI4G9CZkyXxJqqn91vrRnf")
                // 您的AccessKey Secret
                .setAccessKeySecret("KDqYBb223pP7DplXUQMhgzV4rGW6gU");
        // 访问的域名
        config.endpoint = "dysmsapi.aliyuncs.com";
        return new com.aliyun.dysmsapi20170525.Client(config);
    }

//    public static void main(String[] args_) throws Exception {
//        java.util.List<String> args = java.util.Arrays.asList(args_);
//        com.aliyun.dysmsapi20170525.Client client = Sample.createClient("accessKeyId", "accessKeySecret");
//        SendSmsRequest sendSmsRequest = new SendSmsRequest()
//                .setPhoneNumbers("18738102464")
//                .setSignName("我的谷粒学院在线教育网站")
//                .setTemplateCode("SMS_205138330")
//                .setTemplateParam("{\"code\":\"5555\"}");
//        // 复制代码运行请自行打印 API 的返回值
//        client.sendSms(sendSmsRequest);
//    }
}
